package com.mjk.common.web.getway.restful.interceptor.type.export.consts;


import com.mjk.common.util.MapUtils;
import com.mjk.common.web.getway.constns.GetwayConsts;
import com.mjk.common.web.getway.restful.interceptor.GetWayInterceptorReq;
import lombok.Getter;

@Getter
public enum ExportProcessEnum {
	PRE("pre"),PROCESS("process"),DOWN("down"),ALL("all,dict,v1");
	private final String process;
	ExportProcessEnum(String process){
		this.process = process;
	}


    public static boolean isDown(GetWayInterceptorReq req){
		String process = MapUtils.getString(req.getRestfulParams(), GetwayConsts.VERSION);
        return ExportProcessEnum.ALL.getProcess().contains(process)
                || ExportProcessEnum.DOWN.getProcess().equals(process);
    }
}
